package com.bw.controller;

import com.bw.entity.Dict;
import com.bw.entity.Zzt;
import com.bw.mapper.YiMiaoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class EchartsController {

    @Autowired
    YiMiaoMapper yiMiaoMApper;


    @RequestMapping("/tu.do")
    public String tu(Model model){
        // 公司下拉框
     List<Dict> companyList =    yiMiaoMApper.listCompany();

        model.addAttribute("companyList",companyList);
        return "tu";
    }
    @RequestMapping("/zzt.do")
    @ResponseBody
    @Transactional
    public List<Zzt> zzt(Integer companyId){

        return  yiMiaoMApper.zzt(companyId);
    }

}
